﻿<Window x:Class="Demo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Demo"
        xmlns:zen="clr-namespace:BarcodeWpf;assembly=BarcodeWpf"
        mc:Ignorable="d"
        Title="Barcode Demo" Height="500" Width="500">
    <StackPanel Orientation="Vertical" SnapsToDevicePixels="False">
        <TextBox Name="TxbCode" FontSize="24" Padding="2" HorizontalContentAlignment="Center">hello</TextBox>
        <Border Padding="8">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <zen:BarcodeBlock Grid.Row="0" Code="{Binding Text, ElementName=TxbCode}" Background="Beige" Foreground="Green" Height="100"/>
                <TextBlock Grid.Row="1" FontSize="16" HorizontalAlignment="Center" Text="{Binding Text, ElementName=TxbCode}" Margin="8"></TextBlock>
            </Grid>
        </Border>
        <Border Padding="8">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <zen:BarcodeBlock Grid.Row="0" Code="{Binding Text, ElementName=TxbCode}" Symbology="CodeQr" Scale="5" Background="Beige" Foreground="RoyalBlue" Height="200"/>
                <TextBlock Grid.Row="1" FontSize="16" HorizontalAlignment="Center" Text="{Binding Text, ElementName=TxbCode}" Margin="8"></TextBlock>
            </Grid>
        </Border>
    </StackPanel>
</Window>
